package com.jintian.smart.platform.system.provider;

import com.jintian.smart.base.api.system.entity.EmployeeEntity;
import com.jintian.smart.base.api.system.provider.IEmployeeProvider;
import com.jintian.smart.platform.system.service.EmployeeService;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboService;

import java.io.Serializable;
import java.util.List;

@DubboService(timeout = 6000)
public class EmployeeProvider implements IEmployeeProvider {
    @Resource
    private EmployeeService employeeService;

    /*
     *  根据主键获取用户信息
     */
    @Override
    public EmployeeEntity getById(Serializable id) {
        return employeeService.getById(id);
    }

    /*
     *  根据主键批量获取用户信息
     */
    @Override
    public List<EmployeeEntity> listByIds(List<?> idList) {
        return employeeService.listByIds(idList);
    }

    /*
     *  判断用户是否拥有某个角色
     */
    @Override
    public Boolean userExistsRoleCode(String userId, String roleCode) {
        return employeeService.userExistsRoleCode(userId, roleCode);
    }
}
